Hey guys,
// DECLARATION
Stream configFile = read "d:\\CTRS_Config.csv"
exportFile = write("d:\\CTRS_Export.csv")
string targetModule
string modulePrefix
string absoluteNumber
string objectHeading
string reqiredReleaseMirror
string effortEstimation
// READ CONFIG FILE
for (configFile >> targetModule; ! end configFile; configFile >> targetModule)
{
//CHECK IF TARGET IS A MODULE
if (!module(targetModule))
{
errorBox "Target '" targetModule "' is not a Module!\nPlease check Config-File"
halt
}
ModName_ tar = module(targetModule)
ModuleVersion modver = moduleVersion(tar)
Module m = load(modver, false)
modulePrefix = m."Prefix"
Object o
for o in m do
{
absoluteNumber = o."Absolute Number"
objectHeading = o."Object Heading"
reqiredReleaseMirror = o."HB_Required_Release_Mirror"
effortEstimation = o."HB_Effort_Estimation"
// WRITE TO CTRS_Export.csv
exportFile << "\042" fullName(m) "\042,\042" modulePrefix "\042,\042" absoluteNumber "\042,\042" objectHeading "\042,\042" reqiredReleaseMirror "\042,\042" effortEstimation "\042\n"
}
}
print "\nDone!"
ManuelFelger - Mon Aug 10 11:05:04 EDT 2009 |
Re: problem with batch file A potential issue I see is that Absolute Number is an integer. You need to append the empty string after the name. AAI Services, Textron dpechacek@aai.textron.com David.Pechacek@gmail.com |
Re: problem with batch file I see you get two sets of identical errors suggesting the offending DXL is running twice. I also see that the file name of the offending errors is NOT displayed. The DXL that has the Errors is not the DXL that you are running and shown. This leads me to suspect that the user name mentioned in your Batch command line is not the same user that you are testing your DXL with. [1] Some of the modules have a different default view with Layouts or displayed Attr-DXL, and these have the errors in their DXL. This has the feel of an old Layout that does this: othero = target(l) without defining othero as an 'Object', and it gets defined as a ModVer_ handle, and that code never runs for you because you never use the view in question. [2] Its also possible that YOU may have some Current-User 'addins' defined for you client that the other user does not have. I would print the name of the module before 'loading' it in order to see which module is causing the errors.
PS. I'm feeling grouchy and feel like nit-picking: Yes, you should turn your absno into a string: absoluteNumber = o."Absolute Number" "". I wonder why you are not getting an error. Your 'for o in m' loop only retrieves currently displayed objects, which is a function of the default view. I doubt that's really what you want. Perhaps use 'for o in entire m' loop, followe by 'if (isDeleted(o)) continue'. You should define 'ExportFile' as a 'Stream', and close that stream before you halt and before the DXL ends. Turn off AutoDeclare, sheeeesh. Check for null 'm'; maybe the module exists but is deleted. You may want to export "\",\"" (double quote, comma, double quote) instead of "\042,\042" since its easier to understand; at least for those of use that don't do octal-decimal conversions and don't know that Ascii #34 is a double-quote. I wonder what happens when your displayed attr values contain an EOL; it will probably be interpreted by Excel when you open the CSV as end of line. I wonder what happens when your displayed attr values contain a double-quote followed by a comma. |
Re: problem with batch file llandale - Mon Aug 10 13:40:29 EDT 2009
PS. I'm feeling grouchy and feel like nit-picking: Yes, you should turn your absno into a string: absoluteNumber = o."Absolute Number" "". I wonder why you are not getting an error. Your 'for o in m' loop only retrieves currently displayed objects, which is a function of the default view. I doubt that's really what you want. Perhaps use 'for o in entire m' loop, followe by 'if (isDeleted(o)) continue'. You should define 'ExportFile' as a 'Stream', and close that stream before you halt and before the DXL ends. Turn off AutoDeclare, sheeeesh. Check for null 'm'; maybe the module exists but is deleted. You may want to export "\",\"" (double quote, comma, double quote) instead of "\042,\042" since its easier to understand; at least for those of use that don't do octal-decimal conversions and don't know that Ascii #34 is a double-quote. I wonder what happens when your displayed attr values contain an EOL; it will probably be interpreted by Excel when you open the CSV as end of line. I wonder what happens when your displayed attr values contain a double-quote followed by a comma.
first of all thank you for your reply!
string myString = "\nword\nword\n\nword\n"
string deleteAllEOL(string stringToClear)
{
bool a
string sub = "\n"
int offset
int length1
bool matchCase = true
bool reverse = true
string s1
string s2
string snew = ""
a = findPlainText(stringToClear, sub, offset, length1, matchCase, reverse)
for (a == true)
{
s1 = stringToClear[0:offset-1]
s2 = stringToClear[offset+1:(length(stringToClear))]
stringToClear = s1 s2
a = findPlainText(stringToClear, sub, offset, length1, matchCase, reverse)
}
return stringToClear
}
string newString = deleteAllEOL(myString)
print "newString: " newString ""
|
Re: problem with batch file ManuelFelger - Wed Aug 12 10:43:09 EDT 2009
first of all thank you for your reply!
string myString = "\nword\nword\n\nword\n"
string deleteAllEOL(string stringToClear)
{
bool a
string sub = "\n"
int offset
int length1
bool matchCase = true
bool reverse = true
string s1
string s2
string snew = ""
a = findPlainText(stringToClear, sub, offset, length1, matchCase, reverse)
for (a == true)
{
s1 = stringToClear[0:offset-1]
s2 = stringToClear[offset+1:(length(stringToClear))]
stringToClear = s1 s2
a = findPlainText(stringToClear, sub, offset, length1, matchCase, reverse)
}
return stringToClear
}
string newString = deleteAllEOL(myString)
print "newString: " newString ""
|